package com.globalblue;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Paths;

import com.globalblue.view.ImprovedMainWindow;

public class FileDownloader {
	public void downloadFile(URLConnection urlConnection, String destination, ImprovedMainWindow window) {

		try {
			InputStream is = urlConnection.getInputStream();
			Files.copy(is, Paths.get(destination));
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
